/**
 * useState 练习 - 改变背景颜色
 */
import React from 'react'
import { useState } from 'react'

export default function ChangeBg() {
  //声明状态
  let [color, setColor] = useState('#258');

  //声明函数
  let changeColor = () => {
    setColor('#ca9');
  }

  return (
    <div onClick={changeColor} style={{width: 300, height: 200, background: color}}></div>
  )
}
